package com.naiterui.ehp.bs.esign.entity.mysql;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;

import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * 免密签署记录表
 *
 * @author yangfuya
 * @version 1.0
 * @date 2021/4/28 19:25
 **/
@Data
@Entity
@Builder
@Table(name = "esign_no_secret")
@NoArgsConstructor
@AllArgsConstructor
public class EsignNoSecret {

    /**
     * 医师
     */
    public static final Integer SIGN_USER_TYPE_DR = 0;
    /**
     * 药师
     */
    public static final Integer SIGN_USER_TYPE_PH = 1;

    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    private Long id;

    /**
     * 签名用户Id
     */
    @Column(name = "sign_user_id")
    private Long signUserId;

    /**
     * 签名用户类型：0.医师 1.药师
     */
    @Column(name = "sign_user_type")
    private Integer signUserType;

    /**
     * 告知书名
     */
    @Column(name = "inform_name")
    private String informName;

    /**
     * 告知书地址
     */
    @Column(name = "inform_url")
    private String informUrl;

    /**
     * 签名后的文件
     */
    @Column(name = "sign_url")
    private String signUrl;

    /**
     * 状态：0.未签 1.签名成功 2.签名失败
     */
    @Column(name = "status")
    private Integer status;

    /**
     * 创建时间
     */
    @Column(name = "sign_time")
    private Date signTime;

    /**
     * 创建时间
     */
    @Column(name = "created_at")
    private Date createdAt;

    /**
     * 乐观锁
     */
    @Version
    private Integer version;
}
